<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8" import="com.sfilyh.util.DBUtil" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8">
    <title>${article.title}-sfilyh的博客</title>
    <!-- Bootstrap -->
     <style>
      body {
        padding-top: 60px; /* 60px to make the container go all the way to the bottom of the topbar */
 	    padding-bottom: 40px;
      }
     </style>
    <link href="<%=request.getContextPath()%>/css/bootstrap.min.css" rel="stylesheet">
  </head>
  <body>
  
   <jsp:include page="/WEB-INF/views/top.jsp" />
   
    <div class="container">
      <div class="row">
	      <div class="span9">
	       <c:choose>
	       		<c:when test="${article.status == 0}">
	       			<div>
		            	<h2><a href="#">${article.title}</a></h2>
		                <span>sfilyh 发表于${article.ftime} / 分类：<a href="<%=request.getContextPath()%>/article?cid=${article.category}">${article.cname}</a></span>
		            	<div style="margin-top:10px;">
		                <c:choose>
				        	<c:when test='${article.ispass == 0 || empty article.ispass || artilce_pwd.get(article.id.toString())}'>
				        		${article.content}
				        	</c:when>
				        	<c:otherwise>
				        		<c:if test="${error}">
					        		<div class="alert alert-error" style="width:270px;">			              
						              <strong>Error!</strong> 密码错误!
						            </div>
					            </c:if>
					        	<form action="<%=request.getContextPath()%>/password" method="post">
					            	<input type="hidden" name="id" value="${article.id}" />
									<jsp:include page="/WEB-INF/views/airticle_password.jsp" />
								</form>  
					        	</c:otherwise>
				        </c:choose>  
		                </div>
		                <hr />
		            </div>
	       		</c:when>
	       		<c:when test="${article.status == 2}">
	       			<div>
	       				<legend>${article.title}</legend>
	       				${article.content}
	       			</div>
	       		</c:when>
	       </c:choose>
          	
            
          <ul class="nav nav-tabs">
			  <li class="active">
				<a href="javascript:;">文章评论</a>
			  </li>			  
		 </ul>
		 
         <div id="commentList">
				<!-- Duoshuo Comment BEGIN -->
					<div class="ds-thread" data-thread-key="${article.id}" data-title="${article.title}" data-url="http://blog.sfilyh.com/<%=request.getContextPath()%>view?id=${article.id}"></div>
					<script type="text/javascript">
					var duoshuoQuery = {short_name:"dsview"};					
					</script>
				<!-- Duoshuo Comment END -->
        
          </div><!--commentList-->
                  
          </div> 
          
          <jsp:include page="/WEB-INF/views/right.jsp" />   
      </div>
    </div> <!-- /container -->
   
    <jsp:include page="/WEB-INF/views/footer.jsp" />
    
    <script src="http://code.jquery.com/jquery-latest.js"></script>
    <script src="<%=request.getContextPath()%>/js/bootstrap.min.js"></script>
  </body>
</html>